package com.someclip.component.skins
{
	import com.someclip.component.controlls.SimpleButtonExtend;

	import flash.display.DisplayObject;
	import flash.display.GradientType;
	import flash.display.Shape;
	import flash.display.SimpleButton;
	import flash.geom.Matrix;
	import flash.geom.Rectangle;

	public class DefaultButtonSkin extends SimpleButtonExtend
	{
		private var _defaultWidth:Number=75;
		private var _defaultHeight:Number=20;
		private var _upStyle:Shape;
		private var _overStyle:Shape;
		private var _downStyle:Shape;

		public function DefaultButtonSkin(border:int=-1)
		{

			_upStyle=new Shape();
			if (border > 0)
			{
				_upStyle.graphics.lineStyle(border, 1);
			}
			_upStyle.graphics.beginFill(0xcccccc, .8);
			_upStyle.graphics.drawRoundRect(0, 0, _defaultWidth, _defaultHeight, 4);
			_upStyle.graphics.endFill();
			this.upState=_upStyle;
			_overStyle=new Shape();
			if (border > 0)
			{
				_overStyle.graphics.lineStyle(border, 1);
			}
			_overStyle.graphics.beginFill(0x99D7FE, .8);
			_overStyle.graphics.drawRoundRect(0, 0, _defaultWidth, _defaultHeight, 4);
			_overStyle.graphics.endFill();
			this.overState=_overStyle;
			_downStyle=new Shape();
			if (border > 0)
			{
				_downStyle.graphics.lineStyle(border, 1);
			}
			_downStyle.graphics.beginFill(0xaaaaaa, 1);
			_downStyle.graphics.drawRoundRect(0, 0, _defaultWidth, _defaultHeight, 4);
			_downStyle.graphics.endFill();
			this.downState=_downStyle;
			this.hitTestState=_upStyle;
			var rect:Rectangle=new Rectangle(4, 4, _defaultWidth - 8, _defaultHeight - 8);
			_upStyle.scale9Grid=rect;
			_overStyle.scale9Grid=rect;
			_downStyle.scale9Grid=rect;
			rect=null;
			super(_upStyle, _overStyle, _downStyle, _upStyle);

		}
	}
}
